<#-- 

This file contains utility macros that help simplify FreeMarker templating.

$Id: macroUtils.ftl 2023 2006-02-18 01:16:42 +0000 (Sat, 18 Feb 2006) erik $

NOTE: IF YOU ADD A NEW MACRO, YOU *MUST* COMMENT IT. NO EXCEPTIONS.

-->

<#--
Purpose: Capitalized whatever is passed in
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro cap input>${input?cap_first}</#macro>

<#--
Purpose: Makes first letter lowercase
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro uncap input>${input?uncap_first}</#macro>

<#--
Purpose: Makes the whole input UPPERCASE
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro upper input>${input?upper_case}</#macro>

<#--
Purpose: Makes the whole input lowercase
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro lower input>${input?lower_case}</#macro>

<#--
Purpose: Pluralizes the input
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro plural input><#assign output = util.pluralize(input)>${output}</#macro>

<#--
Purpose: Pluralizes the input with uppercase first char
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro pluralCap input><#assign output = util.pluralize(input)>${output?cap_first}</#macro>

<#--
Purpose: Pluralizes the input with lowercase first char
Params: A generic param
Author: Erik Gustavson
Date: August 27, 2005
-->
<#macro pluralUncap input><#assign output = util.pluralize(input)>${output?uncap_first}</#macro>

<#--
Purpose: Determine if the entity requires the auditable annotation
Params: an Entity
Author: Erik Gustavson
Date: November 15, 2005
-->
<#macro auditable entity><#if entity.isAuditable()><#nested></#if></#macro>

<#--
Purpose: Determine if the entity requires the evaluatable annotation
Params: an Entity
Author: Erik Gustavson
Date: November 15, 2005
-->
<#macro evaluatable entity><#if entity.isEvaluatable()><#nested></#if></#macro>